function getSpaces(){
	var url = document.getElementById("url").value;
	var uid = document.getElementById("uid").value;
	var pwd = document.getElementById("pwd").value;

	if (url == "" || uid == "" || pwd == ""){
		return;
	}
	
	new Ajax.Request('$req.contextPath/secure/admin/XWikiAdminAction!chooseSpaces.jspa?decorator=none',{
		    method:'get',
			parameters: {url: url, uid: uid, pwd: pwd},
		    onSuccess: function(transport){
				var spaceArea = document.getElementById("spacearea");								
				var response = transport.responseText;
				var spaces = response.split(",");

				spaceArea.innerHTML = "&nbsp;";
				if (response == ""){
					spaceArea.appendChild(document.createTextNode(messages[0]));
					return;
				}
				
				for (var i = 0; i < spaces.length; i++){
					var space = spaces[i];
					var check = document.createElement("INPUT");
					var textNode = document.createTextNode(" "+space+" ");
					
			    	check.setAttribute("type", "checkbox"); 
			    	check.setAttribute("value", space);  
			    	check.setAttribute("name", "spaces");

			    	spaceArea.appendChild(check);
			    	spaceArea.appendChild(textNode);
				}
		    },
		    onFailure: function(){ 
		    	var textNode = document.createTextNode(messages[1]);
		    	var spaceArea = document.getElementById("spacearea");
		    	spaceArea.appendChild(textNode);
		}
	});			    
}

function rowHover(row)	{
	row.oldClassName = row.className;
	row.className = 'rowHover';
	row.onmouseout = function()  {
		this.className = this.oldClassName;
	}
}